@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --dark: #191927; /* Vector Dark */
  --dark-rgb: 25, 25, 39;

  --primary: #28d9f2; /* Vector Greenish Blue */
  --primary-rgb: 40, 217, 242;

  --primary-dark: #00a9bc; /* Vector Darker Greenish Blue */
  --primary-dark-rgb: 0, 169, 188;

  --secondary: #f44af5; /* Vector Magenta */
  --secondary-rgb: 244, 74, 245;

  --purple-v: #98f; /* Vector Purple */
  --purple-v-rgb: 153, 136, 255;

  --aa-primary-color: var(--dark-rgb);
  --aa-primary-color-rgb: var(--dark-rgb);
  --aa-input-border-color-rgb: var(--dark-rgb);
  --aa-input-border-color-alpha: 0.25;
}

@layer components {
  .code-sample-filename {
    @apply font-semibold font-mono tracking-wide text-gray-200 dark:text-gray-200 bg-dark dark:bg-black py-1.5 px-2 rounded text-sm;
  }
}

.hover\:underline {
  border-bottom: 1px solid transparent;
}

@variants hover {
  .underline {
    text-decoration: none;
    border-bottom: 1px solid #f44af5;
  }
}

[x-cloak] {
  display: none !important;
}

/* Some rules that Tailwind can't really cover */
.jump + .jump,
.admonition + .admonition {
  margin-top: 0.5rem;
}

.svg svg {
  max-width: 100%;
  height: auto;
}

footer ion-icon[name="logo-github"]:hover {
  @apply dark:text-gray-500;
}

a[type="button"] {
  -webkit-appearance: unset;
}

/* Algolia search */
:root {
  --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230),
    inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
}

.aa-DetachedFormContainer,
.aa-Form {
  position: relative;
}

.aa-Form:focus-within {
  box-shadow: none;
}

@media screen and (max-width: 1279px) {
  .aa-Autocomplete .aa-DetachedSearchButton {
    @apply border-0;
  }

  .aa-Autocomplete .aa-DetachedSearchButtonPlaceholder {
    @apply hidden;
  }
}

.aa-DetachedSearchButton:hover .aa-DetachedSearchButtonIcon {
  color: var(--primary-dark);
  cursor: pointer;
}

.dark .aa-DetachedSearchButton:hover .aa-DetachedSearchButtonIcon {
  color: var(--secondary);
}

.aa-DetachedSearchButton:focus {
  outline: none;
  box-shadow: none;
}

.aa-Input:focus {
  outline: none;
  --tw-ring-color: var(--dark-rgb);
}

.aa-InputWrapperSuffix {
  opacity: 0;
}

.aa-DetachedCancelButton {
  opacity: 0.65;
  position: absolute;
  right: 3.5%;
  padding: 8px;
  margin: 0;
  top: calc(var(--aa-spacing-half) * 1.5 + 4px);
  bottom: calc(var(--aa-spacing-half) * 1.5 + 4px);
}

.aa-DetachedCancelButton:hover,
.aa-DetachedCancelButton:focus {
  color: var(--primary-dark);
  box-shadow: none;
  opacity: 1;
}

.dark .aa-DetachedCancelButton:hover,
.dark .aa-DetachedCancelButton:focus {
  color: var(--secondary);
}

.aa-Column {
  padding: calc(var(--aa-spacing-half) / 2) 0;
  padding-top: 0;
}

.aa-PanelLayout {
  padding: 0;
  overflow-x: hidden;
}

.aa-Detached .aa-DetachedContainer {
  background: none;
}

.aa-DetachedContainer .aa-DetachedFormContainer {
  background: rgba(
    var(--aa-background-color-rgb),
    var(--aa-background-color-alpha)
  );
  padding: calc(var(--aa-spacing-half) * 1.5);
}

.aa-DetachedContainer .aa-Preview {
  display: none;
}

.aa-DetachedContainer--modal .aa-Preview {
  display: block;
}

.aa-PreviewImage {
  display: flex;
  justify-content: center;
  height: 150px;
  margin-bottom: var(--aa-spacing-half);
  padding: var(--aa-spacing-half);
  background: var(--aa-background-color);
  border: 1px solid var(--aa-selected-color);
  border-radius: 3px;
}

.aa-PreviewImage img {
  max-width: 100%;
  object-fit: contain;
}

.aa-PreviewTitle {
  margin-bottom: var(--aa-spacing-half);
  font-weight: bold;
}

.aa-PreviewPrice {
  margin-bottom: var(--aa-spacing-half);
  color: var(--aa-icon-color);
  font-weight: bold;
}

.aa-PreviewDescription {
  max-width: 100%;
  padding: 0.3em 0;
  font-size: 0.85em;
  color: var(--aa-content-text-color);
  overflow-x: hidden;
  text-overflow: ellipsis;
}

.aa-PreviewTitle mark,
.aa-PreviewDescription mark {
  background: none;
  color: var(--aa-primary-color);
}

[data-autocomplete-source-id="hits"] {
  margin-bottom: var(--aa-spacing-half);
}

[data-autocomplete-source-id="suggestions"] .aa-List {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(calc(var(--aa-spacing-half) / 2) * -1px);
}

[data-autocomplete-source-id="suggestions"] .aa-Item[aria-selected="true"] {
  background: none;
}

.aa-Item {
  padding-top: 0;
  padding-bottom: 0;
  display: block;
}

.aa-Item > a {
  display: grid;
  grid-template-columns: 1fr 3fr;
}

.aa-QuerySuggestion {
  display: inline-block;
  margin: calc(calc(var(--aa-spacing-half) / 2) / 2);
  padding: var(--aa-spacing-half) var(--aa-spacing);
  color: rgba(var(--aa-icon-color-rgb), var(--aa-icon-color-alpha));
  font-size: 0.85em;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(
    var(--aa-panel-border-color-rgb),
    var(--aa-panel-border-color-alpha)
  );
  border-radius: 3px;
}

.aa-QuerySuggestion mark {
  background: none;
  font-weight: bold;
  color: currentColor;
}

.aa-Footer {
  padding: 15px;
  box-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgba(69, 98, 155, 0.12);
}

@media screen and (max-width: 679px) {
  .aa-Footer {
    display: none;
  }
}

[data-autocomplete-source-id="suggestions"]
  .aa-Item[aria-selected="true"]
  .aa-QuerySuggestion {
  background: rgba(
    var(--aa-selected-color-rgb),
    var(--aa-selected-color-alpha)
  );
  border-color: transparent;
}

[data-autocomplete-source-id="queryResults"] .aa-Item[aria-selected="true"] {
  background-color: rgba(var(--purple-v-rgb), 0.25);
}

/* Docs Search */
.DocSearch-Commands {
  color: var(--docsearch-muted-color);
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.DocSearch-Commands li {
  align-items: center;
  display: flex;
}

.DocSearch-Commands li:not(:last-of-type) {
  margin-right: 0.8em;
}

.DocSearch-Commands-Key {
  align-items: center;
  background: var(--docsearch-key-gradient);
  border-radius: 2px;
  box-shadow: var(--docsearch-key-shadow);
  display: flex;
  height: 18px;
  justify-content: center;
  margin-right: 0.4em;
  padding-bottom: 1px;
  width: 20px;
}
